<!DOCTYPE html>
<html>
<head>
    <!--[if lt IE 7]>
    <div class="ie6_error">还在用<strong>漏洞百出的IE6浏览器</strong>么？为了您的网络安全，请升级浏览器 <a target="_blank"
                                                                               href="http://browsehappy.com">立即升级</a>
    </div>
    <![endif]-->

    <meta charset="utf-8">
    <title>订单详情-审批中-文具1号</title>
    <meta name="description"
          content="文具1号作为上海办公用品供货商公司,专为世界500强企业及SOHO办公族提供网上商城一站式办公耗材批发及采购服务,一站式选购办公日用文具用品,厂家直销,好货又便宜【阳光采购就上文具1号 阳光价格 老板放心 品质保障 员工省力】"/>
    <meta name="keywords" content="办公用品,办公文具,办公文具网站,文具网站,办公用品网,文具采购网,金万年"/>
    <meta name="copyright" content="上海易推信息科技有限公司"/>
    <meta name="renderer" content="webkit">
    <base href="<?php echo base_url(); ?>"/>
    <link rel="shortcut icon" href="favicon.ico"/>
    <link rel="stylesheet" href="public/js/layui/css/layui.css">
    <link rel="stylesheet" type="text/css" href="public/css/base.css"/>
    <link rel="stylesheet" type="text/css" href="public/css/common.css"/>
    <link rel="stylesheet" type="text/css" href="public/css/index.css"/>
    <link rel="stylesheet" type="text/css" href="public/css/list_bought.css"/>
    <link rel="stylesheet" type="text/css" href="public/css/order-manage.css"/>
    <link rel="stylesheet" type="text/css" href="public/css/buyerOrderDetail.css"/>
    <!--[if lte IE 9]>
    <script type="text/javascript" src="public/js/html5shiv-printshiv-3.js"></script>
    <![endif]-->
</head>
<body>
<div class="bg bg-ef">
    <!--common - head -->
    <?php $this->load->view('common/header.php');?>

    <!--common - head end-->

    <div class="container mt20">
        <div class="order-manage-approve-container">
            <p class="path-tit">
                <em class="color-red">订单管理</em>＞审批订单＞订单详情
            </p>
            <div class="order-manage-approve-cont">
                <div class="J_detail_panel grid-c">
                    <i class="step-point step-point-1-2"></i>



                    <div class="J_trade_status-wrapper" style="width:100%;overflow:hidden;">
                        <div class="J_trade_status-wrapper-left" style="float:left; width:266px;">
                            <div class="J_trade_status" style="display: block;float:left;">
                                <table class="trade-status-table">
                                    <tbody>
                                    <tr>
                                        <td class="J_trade_imfor table-td" >
                                            <div class="trade-imfor-title">
                                                <h3>订单信息</h3>
                                            </div>
                                            <ul>
                                                <li class="table-list">
                                                    <div class="trade-imfor-dt">收货地址：</div>
                                                    <div class="trade-imfor-dd">
                                                        <div class="address-detail" style="visibility: visible;">
                                                            <?php if ($result['address_name']): ?>
                                                            <?=$result['address_name']?>，<?=$result['address_phone']?>，<?=$result['address_province']?><?=$result['address_city']?>，<?=$result['address_district']?><?=$result['address_address']?>，
                                                            <?php else: ?>
                                                                自提
                                                            <?php endif;?>
                                                        </div>
                                                    </div>
                                                </li>
                                                <li class="table-list">
                                                    <div class="trade-imfor-dt">买家留言：</div>
                                                    <div class="trade-imfor-dd message-detail" title="" style="visibility: visible;"><span class="no-content"><?=$result['remark']?></span></div>
                                                </li>
                                                <li class="table-list"><div class="trade-imfor-dt">发票信息：</div><div class="trade-imfor-dd imfor-short-dd"> <span class="short-dd-nick">
                                                            <?php if ($result['invoice_type'] == 1): ?>
                                                                增值税专用发票
                                                            <?php elseif ($result['invoice_type'] == 2): ?>
                                                                增值税普通发票
                                                            <?php endif;?>
                                                        </span></div>
                                                    <div class="drop-down-container order-number">
                                                        <span class="more-detail">详情</span>
                                                        <div class="small-drop-down">
                                                            <div class="drop-down-content trade-detail-list" style="right: -162px;text-align: left">
                                                                <div class="list-pointer"></div>
                                                                <table class="trade-dropdown-table">
                                                                    <tbody>
                                                                    <tr>
                                                                        <td class="trade-dropdown-title">
                                                                            <div>
                                                                                发票抬头：<?=$result['invoice_company_name']?>                                                   </div>
                                                                        </td>
                                                                        <td style="width: 25px">&nbsp;</td>
                                                                        <td class="trade-dropdown-title">
                                                                            <div>注册电话：<?=$result['invoice_tel']?></div>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td class="trade-dropdown-title">
                                                                            <div>纳税人识别码：<?=$result['invoice_code']?></div>
                                                                        </td>
                                                                        <td style="width: 25px">&nbsp;</td>
                                                                        <td class="trade-dropdown-title">
                                                                            <div>开户银行：<?=$result['invoice_bank']?></div>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td class="trade-dropdown-title">
                                                                            <div>注册地址：<?=$result['invoice_address']?></div>
                                                                        </td>
                                                                        <td style="width: 25px">&nbsp;</td>
                                                                        <td class="trade-dropdown-title">
                                                                            <div>银行账号：<?=$result['invoice_account']?></div>
                                                                        </td>
                                                                    </tr>
                                                                    </tbody>
                                                                </table>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </li>
<!--                                                <li class="table-list separate-top">-->
<!--                                                    <div class="trade-imfor-dt">订单编号：</div>-->
<!--                                                    <div class="trade-imfor-dd imfor-short-dd">0010180208040018</div>-->
<!--                                                </li>-->
                                                <li class="table-list merchant-list">
                                                    <div class="trade-imfor-dt imfor-dt-merchant">
                                                        商<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>家：
                                                    </div>
                                                    <div class="trade-imfor-dd imfor-short-dd">
                                <span class="short-dd-nick" title="文具1号超市">文具1号超市<span class="ww-light ww-small" data-nick="文具1号超市">
                                        <a href="" target="_bl
                                        ank" class="ww-inline ww-online" title="点此可以直接和卖家交流选好的宝贝，或相互交流网购体验，还支持语音视频噢。">
                                        </a></span>
                                </span>
                                                    </div>

                                                </li><li class="table-list">
                                                    <div class="trade-imfor-dt">支付方式：</div><div class="trade-imfor-dd imfor-short-dd"><span class="short-dd-nick"></span>

                                                    </div>
                                                </li>
                                            </ul>
                                            <input type="hidden" value="6646" id="orderId">
                                        </td>
                                    </tr>
                                    </tbody>
                                    <tbody>
                                    </tbody>
                                </table>
                            </div>
                            <div class="J_trade_status" style="display: block;float:left; margin-top:10px;">
                                <table class="trade-status-table">
                                    <tbody>
                                    <tr>
                                        <td class="J_trade_imfor table-td" >
                                            <div class="trade-imfor-title">
                                                <h3>审批信息</h3>
                                            </div>
                                            <ul>
                                                <li class="table-list">
                                                    <div class="trade-imfor-dt">审批状态：</div>
                                                    <div class="trade-imfor-dd">
                                                        <div class="address-detail color-red" style="visibility: visible;">
                                                            <?php if ($result['status'] == 1): ?>
                                                                审批成功
                                                            <?php elseif ($result['status'] == 0): ?>
                                                                已取消
                                                            <?php elseif ($result['status'] == 2 || $result['status'] == 4): ?>
                                                                审批中
                                                            <?php elseif ($result['status'] == 3 || $result['status'] == 5): ?>
                                                                审核未通过
                                                            <?php endif;?>
                                                        </div>
                                                    </div>
                                                </li>
                                                <li class="table-list">
                                                    <div class="trade-imfor-dt">审  批 人：</div>
                                                    <div class="trade-imfor-dd message-detail" title="" style="visibility: visible;"><span class="color-blue"><?=$parent_name?></span></div>
                                                </li>

                                                <li class="table-list separate-top">
                                                    <div class="trade-imfor-dt">提交时间：</div>
                                                    <div class="trade-imfor-dd imfor-short-dd"><?=$result['update_at']?></div>
                                                </li>
                                                <li class="table-list">
                                                    <div class="trade-imfor-dt">备      注：</div>
                                                    <div class="trade-imfor-dd message-detail" title="" style="visibility: visible;"><?=$result['content'] ? $result['content'] : "/"?></div>
                                                </li>

                                            </ul>
                                            <input type="hidden" value="6646" id="orderId">
                                        </td>
                                    </tr>
                                    </tbody>
                                    <tbody>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="J_trade_status-wrapper-right" style="display: block;float:right; width:713px; overflow:hidden;  margin-left:10px">
                        
                            <div class="J_trade_status bg-fff" style="width:672px; height:427px;padding: 20px">
                                <div>
                                    <?php if ($result['status'] == 1): ?>
                                    <h3 style="font-weight: bold;font-size: 13px;margin-bottom: 12px;">
                                        审批已通过， 通过时间：<?=$result['update_at']?>，耗时：<?=$wait_time?>
                                    </h3>
                                    <?php elseif ($result['status'] == 0): ?>
                                        <h3 style="font-weight: bold;font-size: 13px;margin-bottom: 12px;">
                                        订单已取消
                                    <?php elseif ($result['status'] == 2 || $result['status'] == 4): ?>
                                        <?php if($result['status'] == 2 && $identity == 1 ):?>
                                            <h3>
                                                <span style="font-weight: bold;font-size: 13px;margin-bottom: 12px;">待处理， 已耗时 <span style="color: #DC143C;"><?=$wait_time?></span></span>
                                                <a style="margin-left: 100px;">manager审批中</a>
                                            </h3><br>
                                        <?php elseif($result['status'] == 2 && $identity == 2 ):?>
                                            <h3>
                                                <span style="font-weight: bold;font-size: 13px;margin-bottom: 12px;">待处理， 已耗时 <span style="color: #DC143C;"><?=$wait_time?></span></span>
                                                <a class="cancel" val="<?=$result['id']?>" style="margin-left: 150px; border: 1px solid #DCDCDC;color: red;padding: 4px 40px;text-align: center;text-decoration: none; display: inline-block;border-radius: 5px;cursor: pointer;">驳回</a> <a class="approve" val="<?=$result['id']?>" style="margin-left: 20px; border: 1px solid #DCDCDC;color: #fff;padding: 4px 40px;text-align: center;text-decoration: none; display: inline-block;border-radius: 5px;background-color: #DC143C;cursor: pointer;">通过</a>
                                            </h3><br>
                                        <?php elseif($result['status'] == 4 && $identity == 1 ):?>
                                            <h3>
                                                <span style="font-weight: bold;font-size: 13px;margin-bottom: 12px;">待处理， 已耗时 <span style="color: #DC143C;"><?=$wait_time?></span></span>
                                                <a class="cancel" val="<?=$result['id']?>" style="margin-left: 150px; border: 1px solid #DCDCDC;color: red;padding: 4px 40px;text-align: center;text-decoration: none; display: inline-block;border-radius: 5px;cursor: pointer;">驳回</a> <a class="approve" val="<?=$result['id']?>" style="margin-left: 20px; border: 1px solid #DCDCDC;color: #fff;padding: 4px 40px;text-align: center;text-decoration: none; display: inline-block;border-radius: 5px;background-color: #DC143C;cursor: pointer;">通过</a>
                                            </h3><br>
                                        <?php elseif($result['status'] == 4 && $identity == 2 ):?>
                                            <h3>
                                                <span style="font-weight: bold;font-size: 13px;margin-bottom: 12px;">待处理， 已耗时 <span style="color: #DC143C;"><?=$wait_time?></span></span>
                                                <a style="margin-left: 100px;">admin审批中</a>
                                            </h3><br>
                                        <?php endif;?>
                                    <?php else: ?>
                                        <h3 style="font-weight: bold;font-size: 13px;margin-bottom: 12px;">
                                        <span style="color: #DC143C;">审批驳回</span>，<span style="color: #DCDCDC"> 处理时间：<?=$result['update_at']?>，耗时：<?=$wait_time?></span>
                                        </h3> 
                                        <h3 style="font-weight: bold;font-size: 13px;margin-bottom: 12px;">
                                        驳回理由： <?=$reason ? $reason : "/"?> 
                                        </h3>  

                                    <?php endif;?>
                                    </h3>
                                </div>
                                <div class="trade-status-pro-list">
                                    <?php if ($out_month): ?>
                                        <p class="item-container-warn item-container-warn-list">
                                            <span class="icon bg-icon_warn_red">提示</span>
                                            该订单已超出当前可用预算<?=$out_month['exceed_budget']?>元
                                        </p>
                                    <?php endif;?>

                                    <?php if ($out_single): ?>
                                        <?php foreach($out_single_goods as $k=>$v):?>
                                        <div class="item-container">
                                            <?php if($k==0):?>
                                            <p class="item-container-warn">
                                                <span class="icon bg-icon_warn_red">提示</span>
                                                商品价格超出单品预算
                                            </p>
                                            <?php endif;?>
                                            <div class="item-img" style="margin-left:10px;">
                                                <a class="pic s50" href="<?php echo base_url();?>goods/detail?id=<?=$v['goods_id']?>" title="查看商品详情" target="_blank">
                                                    <img src="<?=$v['goods_main_img']?>">
                                                </a>
                                            </div>
                                            <div class="item-meta">
                                                <a class="item-link" href="<?=base_url()?>goods/detail?id=<?=$v['goods_id']?>" title="查看商品详情" target="_blank" style="width: 445px;"><?=$v['goods_name']?></a>
                                                <div class="item-info">
                                                    <?php foreach ($v['goods_attr'] as $key => $value): ?>
                                                        <span><?=$value['name']?> : <?=$value['value']?>&nbsp;&nbsp;</span><br>
                                                    <?php endforeach ?>
                                                    <span>现价 : ¥
                                                        <?php if($v['adjust_price']):?>
                                                            <?=$v['adjust_price']?>
                                                        <?php else:?>
                                                            <?=$v['goods_price']?>
                                                        <?php endif;?>
                                                        
                                                    &nbsp;&nbsp;</span>
                                                </div>
                                            </div>
                                        </div>
                                        <?php endforeach;?>
                                    <?php endif;?>
                                    <?php if ($out_list): ?>
                                        <?php foreach($out_list_goods as $k=>$v):?>
                                        <div class="item-container">
                                            <?php if($k==0):?>
                                            <p class="item-container-warn">
                                                <span class="icon bg-icon_warn_red">提示</span>
                                                商品已超出您的商品选购范围
                                            </p>
                                            <?php endif;?>
                                            <div class="item-img" style="margin-left:10px;">
                                                <a class="pic s50" href="<?=base_url()?>goods/detail?id=<?=$v['goods_id']?>" title="查看商品详情" target="_blank">
                                                    <img src="<?=$v['goods_main_img']?>">
                                                </a>
                                            </div>
                                            <div class="item-meta">
                                                <a class="item-link" href="<?=base_url()?>goods/detail?id=<?=$v['goods_id']?>" title="查看商品详情" target="_blank" style="width: 445px;"><?=$v['goods_name']?></a>
                                                <div class="item-info">
                                                    <?php foreach ($v['goods_attr'] as $key => $value): ?>
                                                        <span><?=$value['name']?> : <?=$value['value']?>&nbsp;&nbsp;</span><br>
                                                    <?php endforeach ?>
                                                    <span>现价 : ¥
                                                        <?php if($v['adjust_price']):?>
                                                            <?=$v['adjust_price']?>
                                                        <?php else:?>
                                                            <?=$v['goods_price']?>
                                                        <?php endif;?>
                                                    &nbsp;&nbsp;</span>
                                                </div>
                                            </div>
                                        </div>
                                        <?php endforeach;?>
                                    <?php endif;?>



                                </div>
                            </div>

                        </div>

                    </div>

                    <div class="J_bought_listform bg-fff">
                        <table class="bought-listform-maincontent" style="width: 990px;">
                            <tbody>
                            <tr>
                                <td class="header-content-detail">
                                    <ul>
                                        <li class="bought-listform-content">
                                            <table>
                                                <tbody>
                                                <thead class="bought-listform-header bg-ef">
                                                <tr>
                                                    <td class="header-item" style="width:305px;">商品</td>
                                                    <td class="header-price" style="width:95px;">单价</td>
                                                    <td class="header-count" style="width:80px">数量</td>
                                                    <td class="header-price" style="width:90px">小计</td>
                                                    <td class="header-favorable" style="width:170px;"></td>
                                                    <td class="header-status" style="width:120px;">实付款(元)</td>
                                                    <td class="header-logistics" style="width:120px;">状态</td>
                                                </tr>
                                                </thead>
                                                <?php $money = 0;
                                                    $youhui = 0;foreach ($detail['products'] as $k => $vo): ?>
                                                <?php
                                                    $money += $vo['price'] * $vo['count'];
                                                    $youhui += ($vo['price'] * $vo['count'] - $vo['final_price'] * $vo['count']);

                                                    ?>
                                                <tr class="  " data-gid="" data-gcount="1">
                                                    <td class="header-item">
                                                        <div class="item-container">
                                                            <div class="item-img" style="margin-left:10px;">
                                                                <a class="pic s50" href="<?=base_url()?>goods/detail?id=<?=$vo['product_id']?>" title="查看商品详情" target="_blank">
                                                                    <img src="<?=$vo['product_img']?>">
                                                                </a>
                                                            </div>
                                                            <div class="item-meta">
                                                                <a class="item-link" href="<?=base_url()?>goods/detail?id=<?=$vo['product_id']?>" title="查看商品详情" target="_blank" style="245px;"><?=$vo['product_name']?></a>
                                                                <div class="item-info">
                                                                    <?php foreach ($vo['sku_info'] as $key => $val): ?>
                                                                        <span><?=$key?> : <?=$val?>&nbsp;&nbsp;</span>
                                                                    <?php endforeach;?>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </td>
                                                    <td class="header-price font-high-light">  <?=$vo['price']?> </td>
                                                    <td class="header-count font-high-light"><?=$vo['count']?></td>
                                                    <td class="header-favorable">  <?=$vo['price'] * $vo['count']?> </td>
                                                    <?php if ($k == 0): ?>
                                                    <td class="header-status" rowspan="<?=count($detail['products'])?>">
                                                      <!-- <div class="font-high-light">
                                                            <p>包裹一：<em class="color-blue">（运费：￥0.00）</em></p>
                                                           <p><em style="display:inline-block; text-align:left; width:50px;">whity</em> 18721749694
                                                            <p class="tal" style="color:#5c606b;padding: 5px">浙江省杭州市富阳区网商路599号网易大厦
                                                            </div> -->
                                                    </td>
                                                    <td class="header-status" rowspan="<?=count($detail['products'])?>">
                                                        <div class="font-high-light">
                                                         <!-- <p>商品金额：<?=$money?></p>
                                                            <p>优惠：<?=$vo['price'] * $vo['count'] - $vo['final_price'] * $vo['count']?></p> -->
                                                            <p style="color:#C00;font-weight:600">实付金额：<?=$result['money']?></p>
                                                            <p>(含运费：<?=$result['express_fee']?>)</p>
                                                        </div>
                                                    </td>
                                                    <td class="header-status" rowspan="<?=count($detail['products'])?>">
                                                        商品已拍下等待买家付款
                                                    </td>
                                                    <?php endif;?>
                                                    
                                                </tr>
                                                <?php endforeach;?>
                                            </table>

                                        </li>
                                    </ul>
                                </td>

                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="J_total">
                        <table>
                            <tbody>
                            <tr>
                                <td class="total-count">
                                    <div class="total-count-wrapper">
                                        <table class="total-count-detail">
                                            <tbody>
                                            </tbody>
                                        </table>
                                    </div>
                                    <div class="total-count-wrapper">
                                        <div class="total-count-pay-result">
                                            <p><span class="total-title">商品总价：</span><span class="total-amout-y"><?=$money?></span></p>
                                            <p><span class="total-title">- 优惠：</span><span class="total-amout-y"><?=$youhui?></span></p>
                                            <p><span class="total-title">+ 运费：</span><span class="total-amout-y"><?=$result['express_fee']?></span></p>
                                            <p style="border-bottom:2px solid #c00;"></p>
                                            <p style="color:#c00;font-weight:600;"><span class="total-title">订单支付金额：</span><span class="total-amout-y"><?=$result['money']?></span></p>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>

            </div>
        </div>
    </div>
    <?php $this->load->view('common/bottom.php');?>
</div>

<div class="mask" style="display: none;"></div>

<div class="pop pop-account-activation bg-padding-inside none tongyi" style="height: 283px">
    <a href="javascript:;" class="close bg-btn_close_n"></a>
    <p class="top-tit">
        <span class="bg-logo_popup"></span>
    </p>
    <div class="cont">
        <p class="tit" style="margin-top:20px; margin-bottom:50px;">同意该订单通过！</p>
        <div class="btn-box">
            <button class="adjustment-budget-submit adjustment-budget-submit-tongyi">确 定</button>
        </div>
    </div>
</div>

<div class="pop pop-account-activation bg-padding-inside none tongguo" style="height: 283px">
    <a href="javascript:;" class="close bg-btn_close_n"></a>
    <p class="top-tit">
        <span class="bg-logo_popup"></span>
    </p>
    <div class="cont">
        <p class="tit">审批通过</p>
        <p class="intro" style="width:244px; margin: 0 auto">
            由于该订单已超出您当前的预算
            审批通过后将交由admin进行审批
        </p>
        <div class="btn-box">
            <button class="adjustment-budget-submit adjustment-budget-submit-tongguo">确 定</button>
        </div>
    </div>
</div>

<div class="pop pop-account-activation bg-padding-inside none bohui" style="height: 506px">
<a href="javascript:;" class="close bg-btn_close_n"></a>
<p class="top-tit">
    <span class="bg-logo_popup"></span>
</p>
<div class="cont" style="height: auto">
    <p class="tit">审批驳回</p>
    <p class="intro" style="width:314px; margin: 0 auto">
        <a href="javascript:;" class="pop-approve-center-radio specify-reason">
            <span class="icon select" value="无增加预算计划">选择框</span>
            理由一无增加预算计划
        </a>
        <a href="javascript:;" class="pop-approve-center-radio specify-reason">
            <span class="icon " value="无增加单品预算计划">选择框</span>
            理由二无增加单品预算计划
        </a>
        <a href="javascript:;" class="pop-approve-center-radio specify-reason">
            <span class="icon" value="无增加商品类别计划">选择框</span>
            理由三无增加商品类别计划
        </a>
        <a href="javascript:;" class="pop-approve-center-radio other-reason">
            <span class="icon">选择框</span>
            其他理由
        </a>
    </p>
    <textarea name="other" class="pop-approve-center-textarea" cols="30" rows="10" placeholder="请输入审批驳回理由（0~200个字符"
    style="display: none;" "></textarea>
    <div class="btn-box" style="display: block;float: left;">
        <button class="adjustment-budget-submit bohui_insure">确 定</button>
    </div>
</div>

<script type="text/javascript" src="public/js/jquery.min.js"></script>
<script type="text/javascript" src="public/js/index.js"></script>
<script type="text/javascript" src="public/js/owl.carousel.min.js"></script>
<script src="public/js/layui/layui.js"></script>
<script type="text/javascript">



    $(function() {
        //更多订单信息
        $('.drop-down-container').hover(function() {
            $(this).addClass("drop-down")
        }, function() {
            $(this).removeClass("drop-down");
        });
    });


    $('.cancel').click(function() {
      $('.mask').css('display','block');
      $('.bohui').css('display','block');
      $('.bohui').removeClass('none');
      var id = $(this).attr('val');
      console.log(id);
      $('.bohui_insure').attr('val',id);
    })

    $('.other-reason').click(function(){
      $('textarea').css('display','block')
    })
    $('.specify-reason').click(function(){
      $('textarea').css('display','none')
    })
    $('.pop-approve-center-radio').click(function(){
      $(this).find('.icon').addClass('select');
      $(this).siblings().find('.icon').removeClass('select');
      
    })

    //驳回提交
    $('.bohui_insure').click(function() {
      var id = $(this).attr('val');
      var content = $('.intro .select').attr('value');
      if(content == undefined){
        var content = $("textarea[name=other]").val();
      }
      if(content==""){
        layer.msg('驳回理由不可为空');
        return false;
      }
      $.ajax({
        type: "POST",
        url: "<?php echo base_url();?>approve/cancel",
        data: {
          id: id,
          content:content
        },
        dataType: "json",
        success: function(data) {
          if(data.code==0){
            layer.msg(data.msg);
            setTimeout(function(){
              window.location.reload();
            },1000)
          }else{
            layer.msg(data.msg);
          }
        }

      });
    })

    //通过提交
    $('.approve').click(function () {
        var id = $(this).attr('val');
        $.ajax({
            type: "POST",
            url: "approve/judge",
            data: {
                id: id
            },
            dataType: "json",
            success: function (data) {
                if (data.code == 0) {
                    $('.adjustment-budget-submit-tongyi').attr('status',data.data);
                    $('.adjustment-budget-submit-tongyi').attr('val',id);
                    $('.tongyi').removeClass('none'); 
                    $('.tongyi').show(); 
                    $('.mask').removeClass('none');     
                    $('.mask').show();           
                } else if (data.code == 1) {
                    $('.adjustment-budget-submit-tongguo').attr('status',data.data);
                    $('.adjustment-budget-submit-tongguo').attr('val',id);
                    $('.tongguo').removeClass('none'); 
                    $('.tongguo').show(); 
                    $('.mask').removeClass('none');     
                    $('.mask').show(); 
                } else {
                    layer.msg(data.msg);
                }
            }

        });
    })

var flag = true;
//通过提交
$('.adjustment-budget-submit-tongyi,.adjustment-budget-submit-tongguo').click(function () {
    var id = $(this).attr('val');
    var status = $(this).attr('status');
    if(flag == false){
        return false;
    }
    flag = false;
    $.ajax({
        type: "POST",
        url: "approve/agree",
        data: {
            id: id,
            status: status
        },
        dataType: "json",
        success: function (data) {
            if (data.code == -1) {
                layer.msg(data.msg);
            } else {
                location.reload()    
            }
        }

    });
})
</script>

</body>
</html>